<?php
// +----------------------------------------------------------------------
// | YUEGONGBAO [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.yuegongbaofund.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <yuegongbaofund@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\HomeBaseController;
use app\portal\model\PortalCategoryModel;
use app\portal\service\PostService;
use app\portal\model\PortalPostModel;
use think\Db;

class VideoController extends HomeBaseController
{
    public function index()
    {
        return $this->fetch('/video');
    }
	
    public function view()
    {
        $articleId  = $this->request->param('id', 0, 'intval');
		
        if (empty($articleId)) {
            abort(404, '视频不存在!');
        }
		$article = Db::name('portal_post')->where(['id' => $articleId])->find();
        Db::name('portal_post')->where(['id' => $articleId])->setInc('post_hits');
		
		
        $this->assign('article', $article);

        return $this->fetch('/videoview');
    }

}
